package cn.com.yang.datastruct.link;

/**
 * 单链表实现栈
 * @since 20230.07.30
 */
public class StackLinkedList {
    private SingleLink link;
    public StackLinkedList(){
        link = new SingleLink();
    }
    public void push(Object data){
        link.addHead(data);
    }
    //弹出栈元素
    public Object pop(){
        return link.delHead();
    }
    //判断栈是不是空
    public boolean isEmpty(){
        return link.isEmpty();
    }
    //打印
    public void display(){
        link.dispaly();
    }
}

